#ifndef SERIALPORTMONITORTHREAD_H
#define SERIALPORTMONITORTHREAD_H
#include <QThread>
#include <QSerialPort>

class SerialPortMonitorThread:public QThread
{
    Q_OBJECT
public:
    explicit SerialPortMonitorThread(QSerialPort *serialPort, QObject *parent = nullptr);
    ~SerialPortMonitorThread();

protected:
    void run() override;

signals:
    void connectionLost(); //连接断开信号
private:
    QSerialPort *serialPort;
    int checkInterval;  // 检查间隔，单位：毫秒
};

#endif // SERIALPORTMONITORTHREAD_H
